package com.fmi.timedealer;

import com.fmi.timedealer.reporting.ReportsActivity;

import android.app.TabActivity;
import android.content.Intent;
import android.content.res.Resources;
import android.os.Bundle;
import android.widget.TabHost;
import android.widget.TabHost.TabSpec;

public class MainTabActivity extends TabActivity {
	
	protected void onCreate(Bundle savedInstanceState) {
		
		super.onCreate(savedInstanceState);
		setContentView(R.layout.tab_menu);
		Resources res = getResources();
		TabHost tabHost = getTabHost();
		Intent intent;
		TabSpec spec;
		
		intent = new Intent().setClass(this, TimeDealerActivity.class);
		spec = tabHost.newTabSpec("main").setIndicator("Home", 
				res.getDrawable(R.drawable.home)).setContent(intent);
		tabHost.addTab(spec);
		
		intent = new Intent().setClass(this, RunningActivity.class);
		spec = tabHost.newTabSpec("running").setIndicator("Running",
				res.getDrawable(R.drawable.running)).setContent(intent);
		tabHost.addTab(spec);
		
		intent = new Intent().setClass(this, CategoriesViewActivity.class);
		spec = tabHost.newTabSpec("categories").setIndicator("Categories",
				res.getDrawable(R.drawable.magnifier)).setContent(intent);
		tabHost.addTab(spec);	
		
		intent = new Intent().setClass(this, ReportsActivity.class);
		spec = tabHost.newTabSpec("reports").setIndicator("Reports",
				res.getDrawable(R.drawable.reports)).setContent(intent);
		tabHost.addTab(spec);
		
		tabHost.setCurrentTab(0);
	}
}
